/**
 * @author Linrui
 * @since 2011-03-26
 * 企业的数据持久化封装类，继承BaseDao并实现CompanyDao接口
 */
package com.qeado.company.dao.ibatis;

import org.springframework.stereotype.Repository;

import com.qeado.base.BaseDao;
import com.qeado.company.dao.CompanyDao;
import com.qeado.company.model.Company;
import com.qeado.util.PageHelper;
import com.qeado.util.ParameterMap;

@Repository
@SuppressWarnings("unchecked")
public class CompanyDaoImplement extends BaseDao implements CompanyDao {
	
	public PageHelper listAll(int pageNum, int pageSize, String orderBy,
			String asc) {
		return null;
	}

	public PageHelper listByKey(int pageNum, int pageSize, String orderBy, String asc, String key) {
		return null;
	}

	public Company queryById(String id) {
		return (Company)this.getSqlMapClientTemplate().queryForObject("Company.queryById", id);
	}

	public boolean insertCompany(Company company) {
		try {
			this.getSqlMapClientTemplate().insert("Company.insertCompany", company);
			return true;
		} catch (Exception e) {
			e.printStackTrace();
			return false;
		}
	}

	public boolean updateCompany(Company company) {
		try {
			this.getSqlMapClientTemplate().update("Company.updateCompany", company);
			return true;
		} catch (Exception e) {
			e.printStackTrace();
			return false;
		}
	}

	public boolean deleteCompany(String id) {
		try {
			this.getSqlMapClientTemplate().delete("Product.deleteCompany",id) ;
			return true;
		} catch (Exception e) {
			e.printStackTrace();
			return false;
		}
	} 


}
